package com.atguigu;

import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import java.io.IOException;

@WebServlet("/servletB")
public class servletB extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String username = req.getParameter("username");
        String password = req.getParameter("password");
        System.out.println("用户名：" + username + "，密码：" + password);




       /* System.out.println("servletB被访问了");
        String money = req.getParameter("money");
        System.out.println("B"+money);*/

       /* Object requestMessage = req.getAttribute("request");
        System.out.println("请求域:"+requestMessage);


        HttpSession session = req.getSession();
        Object sessionMessage = session.getAttribute("session");
        System.out.println("会话域:"+sessionMessage);

        ServletContext application = req.getServletContext();
        Object appMessage = application.getAttribute("application");
        System.out.println("应用域:"+appMessage);*/


    }
}
